package standardCharsets;

import java.nio.charset.StandardCharsets;
import org.springframework.util.Base64Utils;

/**
 * @program: pangu
 * @description:
 * @author: fengjd
 * @create: 2022-06-23 09:53
 **/
public class StandardCharsetsTest {

    public static void main(String[] args) {
        String str = "abc";
        String encode = new String(Base64Utils.encode(str.getBytes()));
        System.out.println("加密后：" + encode);
        String decode = new String(Base64Utils.decode(encode.getBytes())
                , StandardCharsets.UTF_8);
        System.out.println("解密后：" + decode);
    }
}
